package com.socket.socketMoreTest;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * PetServer--bdqnPractice
 *
 * @author: Jovi
 * @createTime: 2017-09-14 11:07
 **/
public class PetServer {

    public static void main(String[] args) throws IOException {
        ServerSocket ss = new ServerSocket(9091);

        Socket socket;

        int num = 0;

        while (true) {
            socket = ss.accept();
            ServerThreadPet stp = new ServerThreadPet(socket);
            stp.run();
            num++;

            System.out.println("有" + num + "只宠物在本店注册！");
        }

    }
}
